<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="container"></div>
  <script src="jslib/mustache.js"></script>
  <script>
    var data = {
      thing: '手机',
      mood: '开心'
    }

    var templateStr = `我买了一个{{thing}}，好{{mood}}啊`
    var domStr = Mustache.render(templateStr, data)
    var container = document.getElementById('container')
    
    container.innerHTML = domStr
  </script>
</body>
</html>